import router from '..'
import { warn } from '/@/utils/log'
// import './stateGuard'
import projectSetting from '/@/settings/projectSetting'
import { Modal, notification } from 'ant-design-vue'
const { closeMessageOnSwitch } = projectSetting

router.beforeEach(async () => {
  console.log('before')
  try {
    if (closeMessageOnSwitch) {
      Modal.destroyAll()
      notification.destroy()
    }
  } catch (error) {
    warn('message guard error:' + error)
  }
  return true
})
